package com.lanou.musicproject.SQLite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by ztq on 15/11/2.
 */
public class MyManagerDatabase extends SQLiteOpenHelper {

    public static final String downloaded = "downloaded";
    public static final String column_song = "song";
    public static final String column_singer = "singer";
    public static final String column_image = "image";


    public MyManagerDatabase(Context context, String name,
                             SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);

    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        //建表
        //注意空格...
        String createString = "create table " + downloaded + "(" + "_id integer primary key autoincrement, "
                +column_song + " varchar(255)," + column_singer + " varchar(255),"
                +column_image + " varchar(255)"+ ")";
        db.execSQL(createString);

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
